// wx.request({
//     url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/catitems',
//     success:(res)=>{
//         this.setData({
//           navList:res.data.message
//       })
//     }
//   })

export const request = (params) => {
  return new Promise((reslove, reject) => {
      wx.request({
          ...params,
          success: (res) => {
              reslove(res)
          },
          fail: (err) => {
              reject(err)
          },
          complete: () => {
              wx.hideLoading()
          }
      })
  })
}
export let showmodal = (content) => {
  return new Promise((a, b) => {
      wx.showModal({
          title: '提示',
          content:content,
          success: (res) => {
              a(res)
          }
      })

  })

}